package auction.bbs.action;

import java.io.IOException;




import java.util.ArrayList;
import java.util.List;

import auction.bbs.dao.BbsDao;
import auction.bbs.dto.BbsDTO;
import auction.util.PageDTO;
import auction.util.PagingAction;
import auction.util.PagingHelper;



import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
import com.opensymphony.xwork2.Preparable;

@SuppressWarnings({ "serial" })
public class ListAction extends ActionSupport{
	private BbsDTO resultDTO;
	private BbsDao dao;
	private int currentPage=1;	
	private int totalCount; 		
	private int blockCount = 10;
	private int blockPage = 10; 		
	private String pagingHtml; 		
	private PagingAction page; 		
	
	private List<BbsDTO> list;

	public ListAction() throws IOException{
		dao = BbsDao.getinstance();
	
	}
	
	
	public String execute()throws Exception{
		totalCount = dao.getCount();
		list = dao.getListTEST(currentPage);
		page = new PagingAction(currentPage, totalCount, blockCount, blockPage);
		pagingHtml = page.getPagingHtml().toString(); 
		return SUCCESS;
	}





	
	
	

	
	
	public int getCurrentPage() {
		return currentPage;
	}



	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}



	public int getTotalCount() {
		return totalCount;
	}



	public void setTotalCount(int totalCount) {
		this.totalCount = totalCount;
	}



	public int getBlockCount() {
		return blockCount;
	}



	public void setBlockCount(int blockCount) {
		this.blockCount = blockCount;
	}



	public int getBlockPage() {
		return blockPage;
	}



	public void setBlockPage(int blockPage) {
		this.blockPage = blockPage;
	}

/*dfdfdf*/

	public PagingAction getPage() {
		return page;
	}



	public void setPage(PagingAction page) {
		this.page = page;
	}



	public String getPagingHtml() {
		return pagingHtml;
	}



	public void setPagingHtml(String pagingHtml) {
		this.pagingHtml = pagingHtml;
	}






	public List<BbsDTO> getList() {return list;}
	public void setList(List<BbsDTO> list) {this.list = list;}

	
	
}
